public class demo {
    public static void main(String[] args) {
//     static int indexFor(int h, int length) {
//     return h & (length-1);
// }
        int length = 16;
        String k = "a";
        int i = k.hashCode();

        int index1 = i % length;
        int index2 = i & (length - 1);

        System.out.println(index1 == index2);
  System.out.println(index1);
        System.out.println(index2);
        System.out.println(i);

    }
}
